package scheduler;

public class TextValuePair {
	String text;	// Max size 100 chars
	String value;	// Max size 100 chars
	
	public String getText() {
		return text;
	}
	public void setText(String text) {
		this.text = text;
	}
	public String getValue() {
		return value;
	}
	public void setValue(String value) {
		this.value = value;
	}

	public void savePair( int pairNo, BillingSite billingSite, String userId, TextValuePair textValuePair){
		// Write the object to the database
	}

	public TextValuePair loadPair( int pairNo, BillingSite billingSite, String userId){
		// Retrieve the object from the database
		TextValuePair theTextValuePair = null; 
		return theTextValuePair;
	}

	public void deletePair() {
		// This function will delete the parameter from the database
	}

	public String encryptString( String inputValue, String Key) {
		// This function will encrypt the input string, given using the Key
//		System.out.println("encryptString - inputValue [" + inputValue +  "] Length "+ inputValue.length());
		String encryptedString = null;
		if (!(inputValue.isEmpty()))
			encryptedString = "*" + inputValue + "*";
//		System.out.println("encryptString - encryptedString [" + encryptedString +  "]");
		return encryptedString;
//		System.out.println("encryptString - inputValue.isEmpty [" + inputValue.isEmpty() +  "]");
	}

	public String decryptString( String inputValue, String Key) {
		// This function will decrypt the input string, given using the Key
		String decryptedString = null;
		if (!inputValue.isEmpty())
			decryptedString = inputValue.substring(1, inputValue.length()-1);
		return decryptedString;
	}
	
	public String getPair() {
		return this.text + "/" + this.value+ " ";
	}
	
}	

